<?php
namespace Home\Controller;
use Think\Controller;
use Home\Controller\Common;
class RegisterController extends CommonController{
     public function  register(){
             $user_name= I('user_name');
             if(empty($user_name)){
                 $this->ajaxReturn('user_name参数为空,请添加参数');
             }
             file_put_contents('./111.txt',$user_name);
             $where['user_name']=$user_name;
             $where['headimg']='https://www.cwlyz.cn/Public/img/yueding/2.jpg';
             $user_id= M('user')->add($where);
             $this->TimRestApi->account_import($user_id,$user_name,$where['headimg']); 
             $this->TimRestApi->sns_friend_import('laosong',$user_id);
             $this->TimRestApi->sns_friend_import($user_id,'laosong');
             $this->ajaxReturn($user_id);
     }
}